package sctu.edu.java.year2016.team07.nieying.practice.dibazhang.lianxisan;

/**
 * Created by Administrator on 2016/5/26 0026.
 */
public class Zoo {
    public static void main(String[] args){
        Dog dog=new Dog();
        System.out.println("执行Dog.eat();语句时的输出结果是: ");//dog 重写了父类，执行的是子类eat()
        dog.eat();
        Cat cat=new Cat();
        System.out.println("执行Cat.eat();语句时的输出结果是: ");//cat 重写了父类，执行的是子类eat()
        cat.eat();
        Sheep sheep=new Sheep();
        System.out.println("执行Sheep.eat();语句时的输出结果是: ");//sheep没有重写父类，执行的是父类的eat()
        sheep.eat();
    }
}
